//
//  ViewEvalutionTeacherController.m
//  SDSY
//
//  Created by 蓝布鲁 on 2017/4/13.
//  Copyright © 2017年 蓝布鲁. All rights reserved.
//

#import "ViewEvalutionTeacherController.h"
#import "UserInfoModel.h"
#import "EvalutionTeacherModel.h"

@interface ViewEvalutionTeacherController ()
// 视图
@property (strong, nonatomic) IBOutletCollection(UIImageView) NSArray *stars;       // 星星
@property (weak, nonatomic) IBOutlet UILabel *scoreLabel;                           // 分数
@property (weak, nonatomic) IBOutlet UILabel *evalutionLabel;                       // 评论内容

// 数据
//@property (nonatomic,retain) EvalutionTeacherModel *evalutionModel;                 // 评价模型

@end

@implementation ViewEvalutionTeacherController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.title = @"查看评论";
    // 网络请求
//    [self updateEvalution];
    
    // 点亮评分对应的星星
     for (int i = 0; i < self.star; i++) {
         UIImageView *imageView = self.stars[i];
         imageView.image = [UIImage imageNamed:@"star_orange"];
     }
    
    // 更新评分Label
    self.scoreLabel.text = [NSString stringWithFormat:@"%ld分",self.star];
    
    // 更新评分内容
    self.evalutionLabel.text = self.evalution;
    self.evalutionLabel.height = [self.evalution heightWithFont:[UIFont systemFontOfSize:15] width:self.evalutionLabel.width] + 20;
    
}

//#pragma mark - 网络请求
//-(void)updateEvalution {
//    [SVProgressHUD show];
//    [[NetworkTool shareInstance] requireMethodType:POSTType
//                                         URLString:@"SDSY/SDSY/TgetComit"
//                                        parameters:@{@"yid": @(self.yyid)}
//                                           success:^(NSDictionary *respondDictionary) {
//                                               [SVProgressHUD dismiss];
//                                               // 转化模型
//                                               self.evalutionModel = [[EvalutionTeacherModel alloc] initWithDictionary:respondDictionary];
//
//                                               // 点亮评分对应的星星
//                                               for (int i = 0; i < self.evalutionModel.script; i++) {
//                                                   UIImageView *imageView = self.stars[i];
//                                                   imageView.image = [UIImage imageNamed:@"star_orange"];
//                                               }
//
//                                               // 更新评分Label
//                                               self.scoreLabel.text = [NSString stringWithFormat:@"%d分",self.evalutionModel.script];
//
//                                               // 更新评分内容
//                                               self.evalutionLabel.text = self.evalutionModel.evaluationitem;
//                                               self.evalutionLabel.height = [self.evalutionModel.evaluationitem heightWithFont:[UIFont systemFontOfSize:15] width:self.evalutionLabel.width] + 20;
//                                           } failure:^(NSError *error) {
//                                               NSLog(@"%@",error);
//                                           }];
//}




@end
